package com.xbongbong.paas.manager.feign;

import com.xbongbong.admin.pojo.dto.MirrorChartPreviewDTO;
import com.xbongbong.admin.pojo.dto.MirrorInstallAllDTO;
import com.xbongbong.admin.pojo.dto.MirrorInstallDTO;
import com.xbongbong.admin.pojo.dto.MirrorInstructionAllDTO;
import com.xbongbong.admin.pojo.dto.MirrorInstructionDTO;
import com.xbongbong.admin.pojo.dto.MirrorMenuListAllDTO;
import com.xbongbong.admin.pojo.dto.MirrorMenuListDTO;
import com.xbongbong.admin.pojo.dto.MirrorPreviewDTO;
import com.xbongbong.admin.pojo.dto.MirrorRollBackDTO;
import com.xbongbong.admin.pojo.vo.*;
import com.xbongbong.paas.toolbox.wrap.BaseDTO;
import com.xbongbong.paas.toolbox.wrap.XbbResponse;
import com.xbongbong.pro.script.pojo.dto.MirrorUpdateDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @auther: xingxing.xiao
 * @date: 2/28/2020 17:08
 */
@FeignClient(name = "pro-web-mirror",contextId = "mirrorFeignClent")
public interface MirrorFeignClent {

    /**
     * 镜像安装
     * @param lang 语言包参数，默认是zh_CN
     * @param mirrorInstallDTO
     * @author xingxing.xiao
     * @date 2019/1/18 17:15
     */
    @RequestMapping(value = "/pro/v1/mirror/install", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    XbbResponse<MirrorInstallVO> install(@RequestBody MirrorInstallDTO mirrorInstallDTO, @RequestParam("lang") String lang);

    /**
     * 组合镜像安装
     * @param lang 语言包参数，默认是zh_CN
     * @param mirrorInstallAllDTO
     * @author xingxing.xiao
     * @date 2019/1/18 17:15
     */
    @RequestMapping(value = "/pro/v1/mirror/installAll", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    XbbResponse<MirrorInstallAllVO> installAll(@RequestBody MirrorInstallAllDTO mirrorInstallAllDTO, @RequestParam("lang") String lang);

    /**
     * 镜像菜单预览
     * @param mirrorMenuListDTO
     * @author xingxing.xiao
     * @date 2019/1/18 17:15
     */
    @RequestMapping(value = "/pro/v1/mirror/getMenuList", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    XbbResponse<MirrorMenuListVO> getMenuList(@RequestBody MirrorMenuListDTO mirrorMenuListDTO, @RequestParam("lang") String lang);

    /**
     * 组合镜像菜单预览
     * @param mirrorMenuListDTO
     * @author youli.chen
     * @date 2019/1/18 17:15
     */
    @RequestMapping(value = "/pro/v1/mirror/getMenuListAll", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    XbbResponse<MirrorMenuListVO> getMenuListAll(@RequestBody MirrorMenuListAllDTO mirrorMenuListDTO, @RequestParam("lang") String lang);

    /**
     * 表单镜像列表
     * @param mirrorMenuListDTO
     * @return
     * @author xingxing.xiao
     */
    @RequestMapping(value = "/pro/v1/mirror/system/form/list", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    XbbResponse<MirrorSystemMenuListVO> getSystemFormList(@RequestBody MirrorMenuListDTO mirrorMenuListDTO, @RequestParam("lang") String lang);

    /**
     * 组合表单镜像列表
     * @param mirrorMenuListAllDTO
     * @return
     * @author xingxing.xiao
     */
    @RequestMapping(value = "/pro/v1/mirror/system/form/list/all", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    XbbResponse<MirrorSystemMenuListVO> getSystemFormListAll(@RequestBody MirrorMenuListAllDTO mirrorMenuListAllDTO, @RequestParam("lang") String lang);

    /**
     * 工单镜像列表
     * @param mirrorMenuListDTO
     * @author xingxing.xiao
     */
    @RequestMapping(value = "/pro/v1/mirror/workorder/list", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    XbbResponse<MirrorWorkOrderListVO> getWorkOrderList(@RequestBody MirrorMenuListDTO mirrorMenuListDTO, @RequestParam("lang") String lang);

    /**
     * 组合工单镜像列表
     * @param mirrorMenuListDTO
     * @author xingxing.xiao
     */
    @RequestMapping(value = "/pro/v1/mirror/workorder/list/all", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    XbbResponse<MirrorWorkOrderListVO> getWorkOrderListAll(@RequestBody MirrorMenuListAllDTO mirrorMenuListDTO, @RequestParam("lang") String lang);

    /**
     * 图表镜像列表
     * @param mirrorMenuListDTO
     * @author xingxing.xiao
     */
    @RequestMapping(value = "/pro/v1/mirror/chart/list", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    XbbResponse<MirrorChartListVO> getChartList(@RequestBody MirrorMenuListDTO mirrorMenuListDTO, @RequestParam("lang") String lang);

    /**
     * 组合图表镜像列表
     * @param mirrorMenuListDTO
     * @author xingxing.xiao
     */
    @RequestMapping(value = "/pro/v1/mirror/chart/list/all", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    XbbResponse<MirrorChartListAllVO> getChartListAll(@RequestBody MirrorMenuListAllDTO mirrorMenuListDTO, @RequestParam("lang") String lang);

    /**
     * 镜像图表预览
     * @param mirrorChartPreviewDTO
     * @author xingxing.xiao
     */
    @RequestMapping(value = "/pro/v1/mirror/chart/preview", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    XbbResponse<MirrorChartPreviewVO> getChartPreview(@RequestBody MirrorChartPreviewDTO mirrorChartPreviewDTO, @RequestParam("lang") String lang);

    /**
     * 镜像表单预览
     * @param mirrorPreviewDTO
     * @author xingxing.xiao
     * @date 2019/1/18 17:15
     */
    @RequestMapping(value = "/pro/v1/mirror/preview", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    XbbResponse<MirrorPreviewVO> preview(@RequestBody MirrorPreviewDTO mirrorPreviewDTO, @RequestParam("lang") String lang);

    /**
     * 镜像配置信息
     * @param mirrorInstructionDTO
     * @author xingxing.xiao
     * @date 2019/1/18 17:15
     */
    @RequestMapping(value = "/pro/v1/mirror/getMirrorInfo", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    XbbResponse<MirrorConfigVO> getMirrorInfo(@RequestBody MirrorInstructionDTO mirrorInstructionDTO, @RequestParam("lang") String lang);

    /**
     * 镜像简介
     * @param mirrorInstructionDTO
     * @author xingxing.xiao
     * @date 2019/1/18 17:15
     */
    @RequestMapping(value = "/pro/v1/mirror/getMirrorInstruction", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    XbbResponse<MirrorInstructionVO> getMirrorInstruction(@RequestBody MirrorInstructionDTO mirrorInstructionDTO, @RequestParam("lang") String lang);

    /**
     * 组合镜像简介
     * @param mirrorInstructionAllDTO
     * @author xingxing.xiao
     * @date 2019/1/18 17:15
     */
    @RequestMapping(value = "/pro/v1/mirror/getMirrorInstructionAll", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    XbbResponse<MirrorInstructionAllVO> getMirrorInstructionAll(@RequestBody MirrorInstructionAllDTO mirrorInstructionAllDTO, @RequestParam("lang") String lang);

    /**
     * 更新镜像配置信息(图标，简介)
     * @param mirrorUpdateDTO
     * @author xingxing.xiao
     * @date 2019/1/18 17:15
     */
    @RequestMapping(value = "/pro/v1/mirror/updateMirrorInfoScript", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    XbbResponse<MirrorUpdateVO> updateMirrorInfoScript(@RequestBody MirrorUpdateDTO mirrorUpdateDTO, @RequestParam("lang") String lang);

    /**
     * 回退到上一个版本(镜像3.0)
     * @param mirrorRollBackDTO
     * @return
     */
    @RequestMapping(value = "/pro/v1/mirror/rollBackToPrevious", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    XbbResponse<MirrorRollBackVO> rollBackToPrevious(@RequestBody MirrorRollBackDTO mirrorRollBackDTO, @RequestParam("lang") String lang);


    /**
     * 回退到上一个版本(镜像3.0)
     * @param mirrorRollBackDTO
     * @return
     */
    @RequestMapping(value = "/pro/v1/mirror/checkData", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    XbbResponse<MirrorRollBackVO> checkData(@RequestBody MirrorRollBackDTO mirrorRollBackDTO, @RequestParam("lang") String lang);

    /**
     * 获取镜像配置
     * @param baseDTO
     * @param lang
     * @return
     */
    @RequestMapping(value = "/pro/v1/mirror/getMirrorConfigList", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    XbbResponse<MirrorConfigListVo> getMirrorConfigList(@RequestBody BaseDTO baseDTO, @RequestParam("lang") String lang);

}
